//
//  TMGFlowGodlRecrdTableViewCell.m
//  TMGold
//
//  Created by Mac on 2018/3/17.
//  Copyright © 2018年 tangmu. All rights reserved.
//

#import "TMGDealTableViewCell.h"
@interface  TMGDealTableViewCell()


@property(nonatomic, strong) STLabel                     *timeLable;

@end
@implementation TMGDealTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 80;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = [UIColor whiteColor];

    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 0, 100, 40)
                                               text:@"买入黄金"
                                          textColor:FirstTextColor
                                               font:16
                                        isSizetoFit:NO
                                      textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.titleLable];
    
    
    self.timeLable = [[STLabel alloc] initWithFrame:CGRectMake(15, 40, 200, 40)
                                                text:@"2018年03月26日22:34:39"
                                           textColor:SecendTextColor
                                                font:14
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    [self addSubview:self.timeLable];
    
    
    self.moneyLable = [[STLabel alloc] initWithFrame:CGRectMake(0, 0, 200, 40)
                                              text:@"ssd"
                                         textColor:TM_orangeColor
                                              font:16
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentRight];
    self.moneyLable.right = UIScreenWidth - 15;
    [self addSubview:self.moneyLable];
    

}
- (void)setModel:(TMGBuyGoldRecordModel *)model{
    _model = model;
    if (model.trade_type.integerValue == 1) {
        self.titleLable.text = @"买入黄金";
    }else{
        self.titleLable.text = @"卖出黄金";
    }
    self.timeLable.text = model.create_at;
    CGFloat money = model.now_price.floatValue * model.goods_number.floatValue;
    self.moneyLable.text = [NSString stringWithFormat:@"%@%0.2f",@"￥",
                            money];

}
@end

